#include "DI8Input.h"

namespace Input_DI {
	LPDIRECTINPUT8 g_DI;
	bool g_Initialized = false;

	using namespace imInput;

	HRESULT CreateInputDevice(HINSTANCE hDLL, iInputDevice **pDevice, InputDevType Type) {
		if(!*pDevice) {
			switch(Type) {
			case IN_KEYBOARD:
				*pDevice = new DIKBInputDevice();
				break;
			case IN_MOUSE:
				*pDevice = new DIMoInputDevice();
				break;
			};

			return S_OK;
		};
		return E_FAIL;
	};

	HRESULT ReleaseInputDevice(iInputDevice **pDevice) {
		if(!*pDevice) {
			return E_FAIL;
		};
		delete *pDevice;
		*pDevice = NULL;
		return S_OK;
	};
};